package com.sikaryofficial.backend.loader;

import com.sikaryofficial.backend.service.article.cache.ArticleCategoryCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author : qinjinyuan
 * @desc : 文章子标题数据预热
 * @date : 2023/11/28 8:59
 */
@Component
@Slf4j
public class ArticleCategoryLoader implements CommandLineRunner {

    @Autowired
    private ArticleCategoryCacheService categoryCacheService;

    @Override
    public void run(String... args) {
        log.info("start: 文章子标题数据预热=================================");
        categoryCacheService.loadData();
        // categoryCacheService.initData();
        log.info("end: 文章子标题数据预热=================================");
    }
}
